﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PiaoanWeb.AppLogic.BusinessLogicLayer;
using PiaoanWeb.AppLogic.DataAccessLayer;
using PiaoanWeb.Helpers;
namespace PiaoanWeb
{
    public partial class ViewProduct : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ProductsBLL productsBLL = new ProductsBLL();
                Products product = productsBLL.GetProductByID(Convert.ToInt32(Request.QueryString["ProductID"]));
                productNameLbl.Text = product.Name;
                descriptionLbl.Text = WebUtility.HtmlDecode(product.Description);
                productImage.ImageUrl = ResolveUrl(string.Format("~/ProductPictures/" + product.ProductImage));
                categoryLbl.Text = product.Categories.Name;
            }
        }
    }
}